# encoding: UTF-8
# 
# Copyright © 2011 Jesse Sielaff
# 

require 'minitest/autorun'
require 'number'

class TestFloat < MiniTest::Unit::TestCase
  def test_to_number_returns_number_with_same_value
    assert_equal(Number(1.5), (1.5).to_number)
  end
  
  def test_to_number_works_for_positive_infinity
    assert_equal(Number.pos_inf, (Float::INFINITY).to_number)
  end
  
  def test_to_number_works_for_negative_infinity
    assert_equal(Number.neg_inf, (-Float::INFINITY).to_number)
  end
  
  def test_to_number_works_for_nan
    assert_equal(Number.nan, (Float::NAN).to_number)
  end
end
